﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>

  <xsl:include href="functx-1.0-nodoc-2007-01.xslt"/>
  <xsl:template name="IconSet">
    <xsl:param name="c" />
    <xsl:param name="title" />
    <span class="nss {$c}" title="{$title}">
      <xsl:text> </xsl:text>
    </span>
  </xsl:template>

  <xsl:template name="GroupLink">
    <xsl:param name="gid" />
    <xsl:param name="gname" />
    <xsl:param name="rp" />
    <a href="{$rp}/Mod/Groups/ViewGroup.aspx?id={$gid}">
      <xsl:value-of select="$gname"/>
    </a>
  </xsl:template>

  <!-- template 'join' accepts valueList and separator -->
  <xsl:template name="join" >
    <xsl:param name="valueList" select="''"/>
    <xsl:param name="separator" select="','"/>
    <xsl:for-each select="$valueList">
      <xsl:choose>
        <xsl:when test="position() = 1">
          <xsl:value-of select="."/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="concat($separator, .) "/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="JoinUserLink" >
    <xsl:param name="valueList" select="''"/>
    <xsl:param name="separator" select="', '"/>
    <xsl:for-each select="$valueList">
      <xsl:variable name="c">
        
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="position() = 1">
          <control kind="userlink">
            <xsl:attribute name="UserId">
              <xsl:value-of select="MinorParty"/>
            </xsl:attribute>
          </control>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$separator"/>
          <control kind="userlink">
            <xsl:attribute name="UserId">
              <xsl:value-of select="MinorParty"/>
            </xsl:attribute>
          </control>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>
